Skip to content

Fix E_ACCESSDENIED during download if temp is hidden#40708

Open
chemwolf6922 wants to merge 7 commits into
masterfrom
user/chemwolf6922/fix-access-denied-when-downloading-to-hidden-temp
Open

Fix E_ACCESSDENIED during download if temp is hidden#40708
chemwolf6922 wants to merge 7 commits into
masterfrom
user/chemwolf6922/fix-access-denied-when-downloading-to-hidden-temp

Conversation

@chemwolf6922
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

The winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync function does not accept folders with hidden or system attributes. To solve that, this PR creates a sub folder under temp without those attributes and use that for the winrt functions.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Add test UnitTests::UnitTests::ModernDistroInstallWithHiddenTempFolder

Copilot AI review requested due to automatic review settings June 4, 2026 07:46
@chemwolf6922 chemwolf6922 marked this pull request as ready for review June 4, 2026 07:46
@chemwolf6922 chemwolf6922 requested a review from a team as a code owner June 4, 2026 07:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses E_ACCESSDENIED failures during wsl --update / wsl --install downloads when the user’s temp directory has the Hidden/System attributes set, by switching WinRT file operations to a newly-created temp subfolder with those attributes cleared.

Changes:

  • Refactors the existing modern distro install unit test logic into a helper so it can be reused by multiple test cases.
  • Adds a new unit test that exercises modern distro installation when the temp folder is hidden.
  • Updates the WinRT download path selection to use a wsl-downloads subfolder under %TEMP%, explicitly clearing Hidden/System attributes before calling StorageFolder::GetFolderFromPathAsync.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/windows/UnitTests.cpp Refactors the ModernDistroInstall test and adds a regression test for hidden temp folders.
src/windows/common/wslutil.cpp Routes WinRT-based downloads through a temp subfolder with Hidden/System attributes cleared.

Comment thread test/windows/UnitTests.cpp
Copilot AI review requested due to automatic review settings June 4, 2026 08:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread test/windows/UnitTests.cpp
Comment thread test/windows/UnitTests.cpp
Comment thread src/windows/common/wslutil.cpp Outdated
Copy link
Copy Markdown
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good maybe just drop the set when it is not needed.

Copilot AI review requested due to automatic review settings June 5, 2026 02:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/windows/common/wslutil.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants